Welcome to Brighton in three hours.
Hello, everyone, this is like six matplotlib Eleri and Seabourne for data visualizations, by the
end of this feature, you will be able to import and implement Matalote Library in Python to visualize
data and import and implement Seabourne Library in Python to visualize data.
OK, let's import some necessary libraries.
We are here importing our pandas and Nappi and also the math library and Seabourne, the first as MTel
and Seabourne as is Enis.
So let's run this.
So OK, let's practice plotting in order to plot in Nampara.
I'm using nonpaid that Lin space function and here we have to define a minimum value and maximum value
and the total number of intervals that needs this range to be divided to.
And then I'm going to multiply that by PI times two.
So it's basically values between zero and two PI and then assigning to variable X and here my Y value
is just a sign of that X that is so that goes to Y.
In order to plot a function, we can first define a figure with a particular size.
And in order to do that, we use our library that people at that figure function and we didn't function.
We define fixed size equals to at least the first value is the value corresponding to the horizontal
length.
And here is the value corresponding to the vertical lengths.
And as your figure says and here we said it to be five and five in order to plot X and Y, you can use
MTel that populate that plot function.
And here you put your Xs and Y, and then I define a shape and a corresponding color.
The shape is like a dark shape and the corresponding color is are as right.
You can define blue by using B, green by using G or black by using K, and here I'm going to apply
the same plot.
But now in the new figure, I'm going to use that and also color red.
If you're on a cell, you see that this is your sinusoidal curve with a shape and in a duded format.
You see it on the figure at the bottom.
OK, here is another example.
But here we are using PANDAS data frame and our data is that California housing and airline trained
at CSC data, we use their CSFI function and so it as data and we just we can do the top five rows of
it.
So let's run this out.
And here is our data in this.
So I'm going to get all the keys corresponding to this data frame by using the function list, something
data keys is equal to data that keys open and transparent as is without any input.
And this turns all the keys into a list of keys in our data.
Underline keys and I'm going to print it for you.
So let's run the cell.
And here is our list of keys or titles of each column in our data frame.
So we have now this.
So in this cell I define a figure with the size of five by five, similar to the previous cells that
we practice.
And here I'm going to plot for you the population versus the total number of rooms in that data.
The population is actually add column number five or the six column.
Our total number of rooms here is on our fourth column or column number three.
So in order to call the corresponding values to those columns, I use data that I like as my ex or horizontal
values and here as a sum using the plot function within the plot of my library.
So these are our X's and I'm just plotting the first one hundred values.
I don't want to plot all of them corresponding to column number five, which is corresponding to my
population.
And here I should have an exact number of values as I have four exits.
So I'm getting, again, the first one hundred values I had Ghostwood column number three.
I wanted to be plotted blue with a marker to be a star and democracies here to be seven.
So now you can actually define the market size.
And this plus for you, the population versus the number of rooms and the same figure.
I want to have another plot here.
And in this plot, I want to plot the population versus the total number of bedrooms and the total number
of bedrooms in this example goes with column number four.
And I want it to be printed right with a shape to be circle and democratize the circle size to be five.
I'm going to pull out one more thing on that figure, and that is some line just to practice.
And that line connects to point zero zero two point thirty five hundred and eight thousand.
And that line going to be black.
And the corresponding shape to that is Desh.
Not that it doesn't matter if you put the color on the right side or left side, but in the quotation
and instead of my size, since this is a line, we have a line bit and you can set it to any number.
I said it to be three.
So we are basically.
Practicing, drawing some lines.
And here we can define a pig's label and available using a library that people are accessible and available
function, and my X label should actually show you what we have for the X and for the X of these two
plots.
We have our population, so the population in our data keys is key.
Number five, and I want the font of that to be 14 for the Y, we still have the total number of rooms
or the number of bedrooms.
So my label could be DataQuick number three, which is a string.
And then you can add space or space in a quotation to that string using the plus function.
And then plus another key.
And that key is the total number of bedrooms, which is your data key number four and is basically going
to be your Y label.
And I wanted to have preferences of 14.
Since we have multiple plots, we can have legends, world religions.
Show you what we are actually plotting here.
So one of the plot is my population versus the total number of rooms.
That's why I have data keys number five plus space vessels versus space within a condition.
Plus data is three, which is the total number of groups decision.
Second legend, which is corresponding to the second figure is my population versus the total number
of bedrooms.
And that is data key for the third figure is just sublime.
So just have a string.
And with in addition, I have some lines and these are all our agents that are going into a list.
So my list has three dimensions because I have three figures here and the font size of the legends,
I want it to be 14.
So let's run this up.
As I see, I have population and the X axis as my X label.
I have total rooms or total bedrooms on my vertical axis and I have my straight line, some line in
black.
I have population versus in our bedrooms, three circle and right.
And also population versus total number rooms, star and blue.
OK, let's talk about how to plot histograms so you can use your Seabourne Library to plot histograms.
That's actually called distribution plot.
I'm going to actually plot for you the distribution of the first column or column number zero of my
data frame.
So let's run this cell and this is how it has been shown.
And as you see here, you have the value range here, but here you have values between zero and less
than one.
And in order to prevent that and see the frequency here, the actual frequency within the range of every
beanz of your histogram, you have to say kadee equals two false and descale equals to false is something
that actually fix this frequency here for you.
You can also define your total number of pins.
For example, I want the total number of pins to be five here.
So let's run this.
And as I see, we don't have this line here, which is a KDDI line and we have frequency's here and
we have only five bins.
You can also use the function pteropods within the Seabourne Library, and in that case, you can plot
multiple columns versus other columns and also the histograms of different columns of data.
For example, I just pick the first one hundred data and then I want to do these permutations of columns
of histograms and data against one another from column number three to column number six.
So it's basically column number three, four, five.
But six, if you run this, it might take a little bit of time.
And then here you have a collection of different plots, column number three to six in our data frame,
our corresponding to population to the number of bedrooms and total number of rooms.
And here we can see that this plot, for example, is pallotta of total number of bedrooms versus the
total number of rooms or displayed, for example, is population versus total number of bedrooms.
And then we have total number of rooms versus total number of rooms here.
We have just a histogram of total number of rooms or the corresponding column.
For example, here we have the histogram of total number of bedroom or here we have the histogram of
total number of populations.
In this lecture, you learn about how to import and implement Maponya Library in Python to visualize
data and how to import and implement seaborne library in Britain to visualize data.
In the next lecture, we will learn about data repositories and data split in machine learning.
Thank you for your attention.
See you all in the next lecture.